package com.itheima.consumer.listener;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @author zhangyan
 * @date 2021/3/12 23:16
 */

@Component //把普通pojo实例化到spring容器中，声明一个Bean
@RocketMQMessageListener(topic = "demo-topic",consumerGroup = "demo-consumer-group") //监听

public class MessageListener implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {

        System.out.println(message);
    }
}